//
//  NSDate+Time.m
//  SleepingElf
//
//  Created by karong on 2023/6/29.
//

#import "NSDate+Time.h"

@implementation NSDate (Time)
+ (NSString *)bookUpdateStringWithMSTimestamp:(NSTimeInterval)timestamp {
    return [self dateStringWithMSTimestamp:timestamp format:@"d-M"];
}

+ (NSString *)dateStringWithMSTimestamp:(NSTimeInterval)timestamp format:(NSString *)format {
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timestamp];
    NSDateFormatter * dateFormat = [[NSDateFormatter alloc]init];
    [dateFormat setDateFormat:format];
    NSString * string = [dateFormat stringFromDate:date];
    return string;
}

@end
